function Pagination(obj) {
		
		var container = $(obj.container);
		this.formObject = $(obj.fm);
		
		this.currentPage = $.trim($('#currentPage').val());
		this.rowsPerPage = $.trim($('#rowsPerPage').val());
		this.totalCount  = $.trim($('#totalCount').val());
		
		this.curr = container.find('.current');
		this.prev = container.find('.prev');
		this.next = container.find('.next');
		
		this.list = container.find('.num');
		this.init();
		
		return this;
	}
	
	Pagination.prototype = {
		init: function() {
			var self = this, current = parseInt(self.currentPage), size = parseInt(self.rowsPerPage),
				total = parseInt(self.totalCount);
			
			self.prev.on('click', function() {
				if (current !== undefined && current > 1) {
					self.addItems(current - 1, size, total);
					self.submit();
				}
			});
			
			self.next.on('click', function() {
				if (Math.ceil(total / size) > current) {
					self.addItems(current + 1, size, total);
					self.submit();
				}
			});
			
			self.list.on('click', function() {
				var othis = $(this), page = othis.data('page');
				self.addItems(page, size, total);
				self.submit();
			});
		},
		
		submit: function() {
			var self = this;
			self.formObject.submit();
		},
		
		addItems: function(currentPage, rowsPerPage, totalCount) {
			var self = this, fm = self.formObject;
			fm.append("<input type='hidden' name='currentPage' value='" + currentPage  + "'>");
			fm.append("<input type='hidden' name='rowsPerPage' value='" + rowsPerPage  + "'>")
			fm.append("<input type='hidden' name='totalCount' value='" + totalCount  + "'>");
		}
	}

